package com.stox.core.configurer;

import java.awt.BorderLayout;

import com.stox.charting.ui.swing.widget.ChartingToolBar;
import com.stox.core.ui.swing.widget.MainFrame;
import com.stox.design.AfterUiInitializable;
import com.stox.ioc.Container;
import com.stox.navigator.ui.swing.action.NewNavigatorAction;
import com.stox.navigator.ui.swing.view.NavigatorView;

public class ApplicationStartupStateAfterUiInitializable implements
	AfterUiInitializable<Void, Void> {

	@Override
	public boolean isInitialized() {
		return true;
	}
	
	@Override
	public Void invoke(Void payload) {
		ChartingToolBar chartingToolBar = new ChartingToolBar();
		MainFrame.getInstance().getContentPane().add(chartingToolBar, BorderLayout.NORTH);
		
		NewNavigatorAction newNavigatorAction = Container.get(NewNavigatorAction.class);
		newNavigatorAction.actionPerformed(null);
		Container.get(NavigatorView.class);
		
		return null;
	}

	@Override
	public int getOrder() {
		return Integer.MAX_VALUE;
	}

}
